{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dd78d4d0-3c55-43b9-9c7f-ee664704bd7c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdin",
     "output_type": "stream",
     "text": [
      "请输入文件名：\n",
      " 1.csv\n",
      "请输入字符串：\n",
      " ty\n",
      " kk\n",
      " w去\n",
      " qfqf\n"
     ]
    }
   ],
   "source": [
    "filename = input(\"请输入文件名：\\n\")\n",
    "fp = open(filename,\"w\")\n",
    "ch = input(\"请输入字符串：\\n\")\n",
    "while ch != '@':\n",
    "    if '@' in ch:\n",
    "        t = ch.find(\"@\")\n",
    "        fp.write(ch[0:t] )\n",
    "        break \n",
    "    else:\n",
    "        fp.write(ch + \" \")\n",
    "    ch = input(\"\")\n",
    "fp.close()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7e262f0e-c3f5-4bff-a9b4-3c39cd6a5542",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
